#! /bin/sh
IFS="(),"
function print_defs
{
	type=$1
	while read a1 a2 a3
	do
		case $a1 in
		*2)
			id=$(($a2))
			name=$a3
			;;
		*)
			name=$a2
		esac
		printf "%s%s 0x%x\n" $type $name $id
		id=$((id+1))
	done
}
dir=$0
dir=${dir%/*}
dir=$dir/../
id=0
grep ^ITEM $dir/item_def.h | print_defs type_
id=0
grep ^ATTR $dir/attr_def.h | print_defs attr_
